﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Upeu.Venta.Data.Business;
using Upeu.Venta.Data.Entities;

namespace Upeu.Venta.Data.Test.Business
{
    [TestClass]
    public class ComprasBusinessTest
    {
        [TestMethod]
        public void TestGetListByFilter()
        {
            var lista = ComprasBusiness.GetListByFilter("");
            Assert.IsTrue(lista.Count > 0);
        }

        [TestMethod]
        public void TestCreate()
        {
            Compras nuevo = new Compras
            {
                Serie = "Mirian",
                NumDoc = "juliaca",
                FechaCompra = DateTime.Now,
                FechaRegistro = DateTime.Now
            };
            Compras c = ComprasBusiness.Create(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }

        [TestMethod]
        public void TestUpdate()
        {
            Compras nuevo = new Compras
            {
                Id = new Guid("17f1f0b2-99df-e411-84bc-e069958900b1"),
                Serie = "Pablo 2",
                NumDoc = "puno",
                FechaCompra = DateTime.Now,
                FechaRegistro = DateTime.Now
            };
            Compras c = ComprasBusiness.Update(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }
    }
}
